<%@ include file="/common/taglibs.jsp"%>
<title><fmt:message key="regionItemDetail.title"/></title>
<content tag="buttons">
	<probiz:iconBtn btnType="save" onclick="return fnDoSave(this,'regionName');" />
	<c:if test="${region.regionId!=null}">
		<probiz:iconBtn btnType="delete" onclick="return fnDoDelete(this,'regionName');" />
	</c:if>
	<probiz:iconBtn btnType="back" onclick="return fnDoCancelForm(this);" />
</content>
<probiz:showBindErrors bindPath="region.*" />

 <probiz:ui_tabs tabsId="detail" />

<div class="top clearfix">
	<ul class="tab" id="detail">
		<li class="curr">
			<a href="#tab-summary"><span><fmt:message key="regionItemDetail.title"/></span> </a>
		</li>		
	</ul>
</div>
<div class="modify">
	<form class="mainForm" method="post" id="regionForm" name="regionForm" action="${ctxPath}/system/regionItem.html">
		<input  type="hidden" name="regionId"	id="regionId" value="${region.regionId}" />
		<table class="com_modi_table" id="table_content" cellSpacing=0 cellPadding=0
			width="100%" border=0>
			<tr>
				<th colspan="2" class="title"><h4><fmt:message key="region.group.basic"/></h4></th>
			</tr>
			<tr>
				<th class="label_width_1">
					<StoreAdmin:label key="region.regionName" />
				</th>
				<td>
					<input type="text" name="regionName" id="regionName" value="${region.regionName}" style="width:350px" class="inputtxt"/>
				</td>
			</tr>
			<tr>
				<th>
					<StoreAdmin:label key="region.description" />
				</th>
				<td>
					<textarea  name="description" id="description" style="width:350px;height:150px;" class="textareatxt">${region.description}</textarea>
				</td>
			</tr>
		</table>
		<table id="regionItemTable" name="regionItemTable" class="op_table" cellspacing="0" cellpadding="0" border="0" width="100%">
				<tr>
					<th style="width:30%"><fmt:message key="regionItem.itemFullName"/></th>
					<th style="width:20%"><fmt:message key="regionItem.operation"/></th>
					<th><a href="javascript:void(0)" onclick="showDialogOfregionSelector()" class="none"><span class="add_sku"></span><fmt:message key="regionItemDetail.addRegionItem"/></a></th>
				</tr>
			</table>
	</form>
</div>

<script type="text/javascript"	src="${ctxPath}/scripts/probiz/system/userDefinedRegionForm.js?rs=${appConfig.rs}"></script>
<system:regionSelector selectorId="regionSelector" callbackFunc="selectorRegion"/>
<v:javascript formName="region" staticJavascript="false" />
<script type="text/javascript">
$j(document).ready(function () {
	__FMTExtend = {
	    regionItemDetail_delete_confirm:"<fmt:message key="regionItemDetail.delete.confirm"/>"
	};
	$j.extend(__FMT, __FMTExtend); 
});
	
$j(document).ready(function () {
	<c:forEach items="${region.regionItems}" var="regionItem">
		addRegionItem({id:${regionItem.regionItemId},itemId:"${regionItem.item.regionId}",itemFullName:"${regionItem.item.fullName}"});
	</c:forEach>
});

</script>

